import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_websocket/src/flutter_websocket_method_channel.dart';
import 'package:flutter_websocket/src/flutter_websocket_platform_interface.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockFlutterWebsocketPlatform
    with MockPlatformInterfaceMixin
    implements FlutterWebsocketPlatform {
  @override
  Future<void> close(String id) => Future.value();

  @override
  Future<void> connect(String id) => Future.value();

  @override
  Future<void> send(String id, List<int> data) => Future.value();

  @override
  Future<void> sendText(String id, String text) => Future.value();

  @override
  Stream eventFor(String id) {
    throw UnimplementedError();
  }

  @override
  Future<String> create(Uri uri) {
    throw UnimplementedError();
  }
}

void main() {
  final FlutterWebsocketPlatform initialPlatform =
      FlutterWebsocketPlatform.instance;

  test('$MethodChannelFlutterWebsocket is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelFlutterWebsocket>());
  });

  test('open', () async {
    // FlutterWebsocket flutterWebsocketPlugin = FlutterWebsocket();
    // MockFlutterWebsocketPlatform fakePlatform = MockFlutterWebsocketPlatform();
    // FlutterWebsocketPlatform.instance = fakePlatform;

    // expect(await flutterWebsocketPlugin.open(), '42');
  });
}
